
* Set Directory
cd "...Replication Files"

**************************
* Table 1: Summary Stats *
**************************

clear*
use "Data/Analytic_sample.dta", clear

keep if fy >= 2016
drop if fy == 2020

* Wisconsin has some typos
replace perc_pay_er = perc_pay_er /1000 if govtname == "Wisconsin" & fy == 2022
replace perc_req = perc_req /1000 if govtname == "Wisconsin" & fy == 2022
replace requiredcontribution = requiredcontribution * 1000 if govtname == "Wisconsin" & fy == 2022

* Illinois has some typos in the amortperiod for 2015-2016
replace uaalamortperiod_gasb = . if uaalamortperiod_gasb > 40


* Contributions are currently in thousands. Put in billions
replace contrib_er_tot = contrib_er_tot / 1000000
replace contrib_er_excess = contrib_er_excess / 1000000
replace contrib_ee_tot = contrib_ee_tot / 1000000

* This variable is time-invariant.  Only need one year's worth.
replace reps_per_mil_post = . if fy != 2022

* Only need 2021 and 2022 for aid data
replace wider_aid_post = . if fy < 2021
replace narrow_aid_post = . if fy < 2021

* Adjust to be in percentage points
replace blendeddiscountrate = blendeddiscountrate * 100
replace perc_req = perc_req * 100
replace perc_pay_er = perc_pay_er * 100


* Summary Stats
outreg2 using "Table 1", replace word sum(log) keep(contrib_er_tot contrib_er_excess excess_pop contrib_ee_tot perc_req perc_pay_er uaalamortperiod_gasb blendeddiscountrate wider_aid_post narrow_aid_post reps_per_mil_post percent_unemployed funding_ratio snap_hh_share) sortvar(wider_aid_post narrow_aid_post contrib_er_tot contrib_ee_tot perc_pay_er perc_req contrib_er_excess excess_pop uaalamortperiod_gasb blendeddiscountrate reps_per_mil_post funding_ratio percent_unemployed  snap_hh_share) dec(2) eqdrop(N)



****************************************
* Section 5.2: Test of parallel trends *
****************************************

use "Data/Analytic_sample.dta", clear
sort govtname fy

gen wide = wider_aid_post
by govtname: egen wide_gov = sum(wide)
 
sum wider_aid_post if fy == 2022, detail
gen high_aid = wider_aid_post > r(p50)
sort govtname fy
by govtname: egen above_aid = max(high_aid)

gen fy_high = fy * above_aid

gen fy_wider_aid = fy * wide_gov

keep if fy >= 2016
drop if fy == 2020 | fy == 2021 | fy == 2022

reg excess_pop i.gov_group l_percent_unemployed l_snap_hh_share fy fy_wider_aid, cl(govtname) 


*************************
* Table 2: Main Results *
*************************

use "Data/Analytic_sample.dta", clear

* Main Table
keep if fy >= 2016
drop if fy == 2020


* OlS
reg excess_pop wider_aid_post i.gov_group, cl(govtname)
est store main1
outreg2 [main1] using "Table 2", replace keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

reg excess_pop wider_aid_post i.gov_group l_percent_unemployed l_snap_hh_share, cl(govtname) 
est store main2
outreg2 [main2] using "Table 2", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


* IV
ivregress 2sls excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname)  first
est store main3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [main3] using "Table 2", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store main4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [main4] using "Table 2", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)



**************************
* Table 3: Placebo Tests *
**************************

use "Data/Analytic_sample.dta", clear

keep if fy >= 2016
drop if fy == 2020 | fy == 2021 | fy == 2022

gen reps_per_mil_placebo = 0
replace reps_per_mil_placebo = (all_reps/(statepop_2020 / 1000000)) if fy == 2019

gen aid_placebo = 0
replace aid_placebo = (wider_aid_22 * 1000000/ statepop_2020) if fy == 2019

* OLS
reg excess_pop i.gov_group aid_placebo, cl(govtname)
est store placebo1

reg excess_pop i.gov_group l_percent_unemployed l_snap_hh_share aid_placebo, cl(govtname)
est store placebo2


* IV
ivregress 2sls excess_pop i.gov_group (aid_placebo = reps_per_mil_placebo), cl(govtname) first
est store placebo3

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (aid_placebo = reps_per_mil_placebo), cl(govtname) first
est store placebo4

outreg2 [placebo1 placebo2 placebo3 placebo4] using "Table 3", replace keep(aid_placebo)  word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

****************************************
* Table 4: Alternative Measure of Aid  *
****************************************

use "Data/Analytic_sample.dta", clear

keep if fy >= 2016
drop if fy == 2020

* OLS

reg excess_pop narrow_aid_post i.gov_group, cl(govtname) 
est store naraid1
outreg2 [naraid1] using "Table 4", replace keep(narrow_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


reg excess_pop narrow_aid_post i.gov_group l_percent_unemployed l_snap_hh_share, cl(govtname) 
est store naraid2
outreg2 [naraid2] using "Table 4", append keep(narrow_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

* IV

ivregress 2sls excess_pop i.gov_group (narrow_aid_post = reps_per_mil_post),  cl(govtname) first
est store naraid3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [naraid3] using "Table 4", append keep(narrow_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (narrow_aid_post = reps_per_mil_post),  cl(govtname) first
est store naraid4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [naraid4] using "Table 4", append keep(narrow_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


* State-Level
use "Data/Analytic_sample_aggregated.dta", clear

keep if fy >= 2016
drop if fy == 2020

reg excess_pop wider_aid_post i.gov_group, cl(govtname) 
est store agg1
outreg2 [agg1] using "Table 4", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

reg excess_pop wider_aid_post i.gov_group l_percent_unemployed l_snap_hh_share, cl(govtname) 
est store agg2
outreg2 [agg2] using "Table 4", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


* IV
ivregress 2sls excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname)  first
est store agg3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [agg3] using "Table 4", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname)  first
est store agg4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [agg4] using "Table 4", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)



**************************************
* Table 5: Heterogeneity *
**************************************

use "Data/Analytic_sample.dta", clear

sum funding_ratio if fy == 2019, detail
gen high_funding = funding_ratio > r(p50) & fy == 2019
sort govtname fy
by govtname: egen high_funding_indicator = max(high_funding)

keep if fy >= 2016
drop if fy == 2020

* States vs Local Govs

gen local_indicator = state_indicator == 0
gen wider_aid_post_local = wider_aid_post * local_indicator
gen reps_per_mil_post_local = reps_per_mil_post * local_indicator

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post wider_aid_post_local = reps_per_mil_post reps_per_mil_post_local), cl(govtname)
est store het1
estat first
outreg2 [het1] using "Table 5", replace keep(wider_aid_post wider_aid_post_local) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


* High vs Low Funding

gen wider_aid_post_high = wider_aid_post * high_funding_indicator
gen reps_per_mil_post_high = reps_per_mil_post * high_funding_indicator

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post wider_aid_post_high = reps_per_mil_post reps_per_mil_post_high), cl(govtname)
est store het2
estat first
outreg2 [het2] using "Table 5", append keep(wider_aid_post wider_aid_post_high) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


*********************************************
* Table 6: Effects on Actuarial Assumptions *
*********************************************

use "Data/Analytic_sample.dta", clear

keep if fy >= 2016
drop if fy == 2020

* UAAL Amort Period
replace uaalamortperiod_gasb = . if uaalamortperiod_gasb > 40

* OLS

reg uaalamortperiod_gasb wider_aid_post i.gov_group, cl(govtname)
est store assume1
outreg2 [assume1] using "Table 6", replace keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

reg uaalamortperiod_gasb wider_aid_post i.gov_group l_percent_unemployed l_snap_hh_share, cl(govtname) 
est store assume2
outreg2 [assume2] using "Table 6", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

* IV
ivregress 2sls uaalamortperiod_gasb i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname)  first
est store assume3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [assume3] using "Table 6", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls uaalamortperiod_gasb i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store assume4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [assume4] using "Table 6", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)
 
* Discount Rate
replace blendeddiscountrate = blendeddiscountrate * 100
* OLS
reg blendeddiscountrate wider_aid_post i.gov_group, cl(govtname)
est store assume5
outreg2 [assume5] using "Table 6", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

reg blendeddiscountrate wider_aid_post i.gov_group l_percent_unemployed l_snap_hh_share , cl(govtname) 
est store assume6
outreg2 [assume6] using "Table 6", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

* IV
ivregress 2sls blendeddiscountrate i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname)  first
est store assume7
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [assume7] using "Table 6", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls blendeddiscountrate i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store assume8
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [assume8] using "Table 6", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


****************
* Footnote 10  *
****************
use "Data/Analytic_sample.dta", clear

gen discount_rate2019 = 0
replace discount_rate2019 = blendeddiscountrate if fy == 2019
by gov_group: egen discount_rate_2019 = max(discount_rate2019)
gen delta_discount = blendeddiscountrate - discount_rate_2019
gen amort2019 = 0
replace amort2019 = uaalamortperiod_gasb if fy == 2019
by gov_group: egen amort_2019 = max(amort2019)
gen delta_amort = uaalamortperiod_gasb - amort_2019 

gen drop = 0
replace drop = 1 if abs(delta_discount) > 0.001 & delta_discount != . & (fy == 2021 | fy == 2022)
replace drop = 1 if abs(delta_amort) > 1 & delta_amort != . & (fy == 2021 | fy == 2022)

by gov_group: egen num_drop = max(drop)

sum funding_ratio if fy == 2019 & num_drop == 0
sum funding_ratio if fy == 2019 & num_drop == 1

drop if drop == 1

keep if fy >= 2016
drop if fy == 2020

* OlS
reg excess_pop wider_aid_post i.gov_group, cl(govtname)
est store footnote1
outreg2 [footnote1] using "Footnote10", replace keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

reg excess_pop wider_aid_post i.gov_group l_percent_unemployed l_snap_hh_share, cl(govtname) 
est store footnote2
outreg2 [footnote2] using "Footnote10", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


* IV
ivregress 2sls excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname)  first
est store footnote3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [footnote3] using "Footnote10", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store footnote4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [footnote4] using "Footnote10", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)



*************
* Figure 1  *
*************

* Figure 1a
use "Data/Descriptive Sample.dta", clear
drop if miss_tot != 0
drop if ee_miss_tot != 0
collapse (mean) contrib_er_tot contrib_ee_tot, by(fy)
replace contrib_er_tot = contrib_er_tot / 1000000
replace contrib_ee_tot = contrib_ee_tot / 1000000

twoway connected contrib_er_tot fy || connected contrib_ee_tot fy, lpattern(dash) xtitle("Fiscal Year") ytitle("Average Pension Contribution" "(Billions of 2019 dollars)") xline(2020) legend(label(1 "Employer Contribution") label(2 "Employee Contribution") rows(1) position(6))
graph export "Figure 1a.pdf", as(pdf) replace

* Figure 1b
use "Data/Descriptive Sample.dta", clear
drop if miss_tot != 0
drop if pay_miss_tot != 0
* There is a typo in the Wisconsin 2022 payroll number
replace perc_pay_er = perc_pay_er /1000 if govtname == "Wisconsin" & fy == 2022
collapse (mean) perc_pay_er, by(fy)

twoway connected perc_pay_er fy, xtitle("Fiscal Year") ytitle("Average Employer Contribution as" "Percent of Payroll") xline(2020) ylabel(0.22 "22%" 0.23 "23%" 0.24 "24%" 0.25 "25%" 0.26 "26%" 0.27 "27%")
graph export "Figure 1b.pdf", as(pdf) replace
 
 
* Figure 1c
use "Data/Descriptive Sample.dta", clear
drop if miss_tot != 0
drop if req_miss_tot != 0
* There appears to be a typo on the Wisconsin 2022 payroll number
replace perc_req = perc_req /1000 if govtname == "Wisconsin" & fy == 2022
collapse (mean) perc_req, by(fy)
 
twoway connected perc_req fy, xtitle("Fiscal Year") ytitle("Average Employer Contribution as" "Percent of Actuarially Determined Contribution") xline(2020) ylabel(0.94 "94%" 0.98 "98%" 1.02 "102%" 1.06 "106%")
graph export "Figure 1c.pdf", as(pdf) replace

 
* Figure 1d
use "Data\Descriptive Sample.dta", clear
drop if miss_ex != 0
replace contrib_er_excess = contrib_er_excess / 1000000
collapse (mean) contrib_er_excess, by(fy)
 
 twoway connected contrib_er_excess fy, xtitle("Fiscal Year") ytitle("Average Contribution Above Regular Employer Amounts" "(Billions of 2019 Dollars)") xline(2020) yscale(range(0.1(0.05)0.25)) ylabel(0.1(0.05)0.25)
 graph export "Figure 1d.pdf", as(pdf) replace
 
 
*************
* Figure 2  * 
*************

 use "Data\Descriptive Sample.dta", clear
 drop if miss_ex != 0
 replace contrib_er_excess = contrib_er_excess / 1000000
 collapse (mean)  excess_pop, by(fy above_aid)
 
 twoway connected excess_pop fy if above_aid == 1 || connected excess_pop fy if above_aid == 0, lpattern(dash) xtitle("Fiscal Year") ytitle("Average Per Capita Contribution" "Above Regular Employer Amounts") legend(label(1 "Above Median Per Capita Aid") label(2 "Below Median Per-Capita Aid")  rows(1) position(6)) xline(2020) yscale(range(0(10)60)) ylabel(0(10)60)
  graph export "Figure 2.pdf", as(pdf) replace

*************************
* Table A2: First Stage
*************************

use "Data/Analytic_sample.dta", clear

keep if fy >= 2016
drop if fy == 2020


ivregress 2sls excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname)  first 
estat first
local R2 = round(r(singleresults)[1,1], 0.01)

ivreg2 excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname) savefirst
est restore _ivreg2_wider_aid_post
outreg2 using "Table A2", replace keep(reps_per_mil_post) word nocons dec(2) sdec(3) alpha(0.01,0.05) symbol(**,*) addtext( R-squared, `"`R2'"', Gov Fixed Effects, Yes, Covariates, No)

est clear

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname ) first
estat first
local R2 = round(r(singleresults)[1,1], 0.01)

ivreg2 excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) savefirst
est restore _ivreg2_wider_aid_post
outreg2 using "Table A2", append keep(reps_per_mil_post) word nocons dec(2) sdec(3) alpha(0.01,0.05) symbol(**,*) addtext( R-squared, `"`R2'"', Gov Fixed Effects, Yes, Covariates, Yes)


*****************************************************
* Table A3: Results by Year
*****************************************************

use "Data/Analytic_sample.dta", clear

* Main Table
keep if fy >= 2016
drop if fy == 2020

preserve
drop if fy == 2022

* 2021
ivregress 2sls excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store yearly1
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [yearly1] using "Table A3", replace keep(wider_aid_post) adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store yearly2
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [yearly2] using "Table A3", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

restore
drop if fy == 2021

* 2022
ivregress 2sls excess_pop i.gov_group (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store yearly3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [yearly3] using "Table A3", append keep(wider_aid_post) adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = reps_per_mil_post),  cl(govtname) first
est store yearly4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [yearly4] using "Table A3", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


***************************************************************
***** Table A4: Alternative Measure of Congressional Representation
***************************************************************

use "Data/Analytic_sample.dta", clear

* Main Table
keep if fy >= 2016
drop if fy == 2020

* OLS
reg excess_pop wider_aid_post i.gov_group, cl(govtname) 
est store main1
outreg2 [main1] using "Table A4", replace keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

reg excess_pop wider_aid_post i.gov_group l_percent_unemployed l_snap_hh_share, cl(govtname) 
est store main2
outreg2 [main2] using "Table A4", append keep(wider_aid_post) word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


* IV
ivregress 2sls excess_pop i.gov_group (wider_aid_post = alt_reps_per_mil_post),  cl(govtname)  first
est store main3
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [main3] using "Table A4", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)

ivregress 2sls excess_pop i.gov_group l_percent_unemployed l_snap_hh_share (wider_aid_post = alt_reps_per_mil_post),  cl(govtname) first
est store main4
estat first
local Fstat = r(singleresults)[1,4]
outreg2 [main4] using "Table A4", append keep(wider_aid_post)  adds("F-stat", `Fstat') word nocons dec(2) alpha(0.01,0.05) symbol(**,*)


*************************
* Figure A1
*************************

 use "Data/Descriptive Sample.dta", clear
 drop _merge
 keep if state == govtname
 keep if fy == 2020
 rename state NAME
 merge 1:1 NAME using "Data/usstate"
 keep if _merge == 3
 gen high_rep = 0
 replace high_rep = 1 if high == 0
 spmap high_rep using "Data\usstate_shp", id(_ID)  ndsize(0.02 ..)  osize(0.02 ..) /// 
    fcolor(stone) polygon(data("Data\usstate_shp") osize(.2 ..)) legstyle(2) legend(on label(1 "") label(2 "Above Median") label(3 "Below Median") position(4))
 graph export "Figure A1.pdf", as(pdf)

 
**************
* Figure A2  *
**************
  
* Figure A2a
use "Data\Descriptive Sample.dta", clear
drop if pay_miss_tot != 0
replace payroll = payroll / 1000000

* There appears to be a typo on the Wisconsin 2022 payroll number
replace payroll = payroll * 1000 if govtname == "Wisconsin" & fy == 2022

collapse (mean) payroll, by(fy)
twoway connected payroll fy, xtitle("Fiscal Year") ytitle("Average Payroll""(Billions of 2019 dollars)") xline(2020)
 graph export "Figure A2a.pdf", as(pdf) replace

 * Figure A2b
 use "Data\Descriptive Sample.dta", clear
drop if miss_tot != 0
drop if req_miss_tot != 0
replace requiredcontribution = requiredcontribution / 1000000
* There appears to be a typo on the Wisconsin 2022 payroll number
replace requiredcontribution = requiredcontribution * 1000 if govtname == "Wisconsin" & fy == 2022

collapse (mean) requiredcontribution, by(fy)
twoway connected requiredcontribution fy, xtitle("Fiscal Year") ytitle("Average Actuarially Determined Contribution""(Billions of 2019 dollars)") xline(2020)
 graph export "Figure A2b.pdf", as(pdf) replace
 
 
**************************
* Figure A3
*************************

* Figure A3a
 use "Data\Descriptive Sample.dta", clear
 drop if amort_missing != 0
 collapse uaalamortperiod_gasb, by(fy above_aid)
 
twoway connected uaalamortperiod_gasb fy if above_aid == 1 || connected uaalamortperiod_gasb fy if above_aid == 0, lpattern(dash) xtitle("Fiscal Year") ytitle("Amortization Period") legend(label(1 "Above Median Per Capita Aid") label(2 "Below Median Per-Capita Aid")  rows(1) position(6))  xline(2020) 
 graph export "Figure A3a.pdf", as(pdf) replace
 
 * Figure A3b
 use "Data\Descriptive Sample.dta", clear
 drop if discount_missing != 0
 collapse blendeddiscountrate, by(fy above_aid)
 
twoway connected blendeddiscountrate fy if above_aid == 1 || connected blendeddiscountrate fy if above_aid == 0, lpattern(dash) xtitle("Fiscal Year") ytitle("Discount Rate") legend(label(1 "Above Median Per Capita Aid") label(2 "Below Median Per-Capita Aid")  rows(1) position(6))  xline(2020) 
 graph export "Figure A3b.pdf", as(pdf) replace
 